"""
节日节气数据模块
存储中国传统节日、24节气等信息
"""
class FestivalData:
    def __init__(self):
        self.solar_festivals = {
            (1, 1): "元旦",
            (5, 1): "劳动节",
            (10, 1): "国庆节"
            # 添加更多公历节日...
        }

        self.lunar_festivals = {
            (1, 1): "春节",
            (1, 15): "元宵节",
            (5, 5): "端午节",
            (8, 15): "中秋节"
            # 添加更多农历节日...
        }

        self.solar_terms = {
            (1, 5): "小寒", (1, 20): "大寒",
            (2, 4): "立春", (2, 19): "雨水",
            (3, 5): "惊蛰", (3, 21): "春分",
            # 添加更多节气...
        }

    def get_festival(self, year, month, day, lunar_date):
        """获取节日信息"""
        festivals = []

        # 公历节日检查
        if (month, day) in self.solar_festivals:
            festivals.append(self.solar_festivals[(month, day)])

        # 农历节日检查
        lunar_month = lunar_date.lunar_month
        lunar_day = lunar_date.lunar_day
        if (lunar_month, lunar_day) in self.lunar_festivals:
            festivals.append(self.lunar_festivals[(lunar_month, lunar_day)])

        # 节气检查
        if (month, day) in self.solar_terms:
            festivals.append(self.solar_terms[(month, day)])

        return ", ".join(festivals) if festivals else None
